<!--
 * @轮子的作者: 轮子哥
 * @Date: 2023-08-29 15:34:18
 * @LastEditTime: 2023-10-07 10:46:39
-->
<template>
    <MainNavigation v-if="!isolate">
        <router-view v-slot="{ Component }">
            <keep-alive
                :include="['HouseManage', 'CustomManage', 'EmployeeManage', 'PersonnelManage', 'RealEstate', 'MsapFindHouse']">
                <component :is="Component" />
            </keep-alive>
        </router-view>
    </MainNavigation>
    
    <router-view v-slot="{ Component }" v-else>
        <keep-alive
            :include="['HouseManage', 'CustomManage', 'EmployeeManage', 'PersonnelManage', 'RealEstate', 'MsapFindHouse']">
            <component :is="Component" />
        </keep-alive>
    </router-view>
</template>
<script>
import MainNavigation from './components/navigation/MainNavigation.vue';
import { useMenu } from './store/menu'
export default {
    name: 'RoutingMount',
    components: {
        MainNavigation: MainNavigation
    },
    props: {
    },
    data() {
        return {
            menus: useMenu().routes,
            isolate: false
        }
    },
    mounted() {
    },
    methods: {
    },
    watch: {
        '$route'(to) {
            const route = this.menus.filter(v => v.path === to.path)
            if (route.length > 0) {
                if (this.isolate)
                    this.isolate = false
            } else {
                if (!this.isolate)
                    this.isolate = true
            }
        }
    },
    computed: {
    }

}
</script>
<style lang="scss">
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: "微软雅黑";
}

::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 2px;
    /*高宽分别对应横竖滚动条的尺寸*/
    height: 0px;
    background-color: white;
    /*滚动槽颜色*/
}

::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius: 5px;
    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    background-color: #79bbff;
    ;
    /*滚动条颜色*/
}

::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.1);
}

.el-dialog__body {
    height: inherit;
}
</style>
